package stringFun;

import java.util.Scanner;

public class stringDemo1 {
    public static void main(String[] args) {
        //字符串常见方法
        String str = "hello world";
        String str1 = new String("HELLO WORLD");
        System.out.println(str.equalsIgnoreCase(str1));//equalsIgnoreCase忽略大小写比较
        System.out.println(str.equals(str1));

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str2 = sc.next();//键盘录入的是 new 出来的对象
        String str3 = "hello";
        System.out.println(str2 == str3);
        System.out.println(str2.equals(str3));

    }
}
